package com.cyy.maven.core.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cyy.maven.core.dao.SysUserDao;
import com.cyy.maven.core.entity.SysUser;
import com.cyy.maven.core.service.SysyUserService;
import com.cyy.maven.core.utils.MD5Util;

@Service("sysuserservice")
public class SysUserServiceImpl implements SysyUserService {

    @Resource
    private SysUserDao sysuserDao;

    @Override
    public SysUser login(SysUser user) {
        try {
            String MD5pwd = MD5Util.MD5Encode(user.getPassword(), "UTF-8");
            user.setPassword(MD5pwd);
        } catch (Exception e) {
            user.setPassword("");
        }
        return sysuserDao.login(user);
    }

}
